import { UPDATEUSERINFO, UPDATACTHSETTING } from '../mutation-types'

const state = {
  // 用户信息
  userInfo: {
    userInfo: '',
    nickName: '',
    avatarUrl: 'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJUYHWnZz9BGfTbYt9ibPlHcNsh8QmDuIribdXztuibkEFjYl9NZ7pFp5bjrYVRJH0KHRUdDO1A9OFNQ/132',
    gender: '',
    province: '',
    city: '',
    country: '',
    code: '' // wx.login.code
  },
  // 用户授权信息
  authSetting: {}
}
const mutations = {
  [UPDATEUSERINFO] (state, obj) {
    state.userInfo = Object.assign({}, state.userInfo, obj)
  },
  [UPDATACTHSETTING] (state, obj) {
    state.authSetting = Object.assign({}, state.authSetting, obj)
  }
}
export default {
  state,
  mutations
}
